//
//  PKCommunityScrollView.m
//  PianKe
//
//  Created by ybq on 15/12/31.
//  Copyright © 2015年 B7_Young. All rights reserved.
//

#import "PKCommunityScrollView.h"

@implementation PKCommunityScrollView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/



- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    // 判断当前的移动方向 velocity > 0 向右滑 反之...
    CGPoint velocity = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:self];
    // 获取手势在屏幕上的初始点
    CGPoint location = [gestureRecognizer locationInView:self];
    //    NSLog(@"velocity.x:%f----location.x:%d",velocity.x,(int)location.x % (int)kWidth);
    // 判断一下
    if (velocity.x > 0 && (int)location.x % (int)kWidth < 60) {
        return NO;
    }
    return YES;
}


@end
